package org.mybatis3.demo1;

import org.apache.ibatis.session.SqlSession;
import org.mybatis3.demo1.dao.UserMapper;
import org.mybatis3.demo1.pojo.User;
import org.mybatis3.util.MyBatisUtil;

import java.util.ArrayList;
import java.util.List;

public class Test13 {
    public static void main(String[] args) {
        SqlSession sqlSession= MyBatisUtil.getSqlSession();
        List<Long> ids=new ArrayList<Long>();
        ids.add(1L);
        ids.add(2L);
        List<User> users= sqlSession.getMapper(UserMapper.class).getUsersByRole(ids);
        for (User user:users){
            System.out.println(user.getUserName());
        }
        MyBatisUtil.closeSqlSession();
    }
}
